home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / gnu / gnushogi.lha / gnushogi-1.1 / src / debug10.h < prev    next >
C/C++ Source or Header  |  1993-04-16  |  1KB  |  52 lines

  1. #ifdef DEBUG10
  2.       else
  3.         {
  4.           FILE *D;
  5.           int r, c, l;
  6.           struct leaf *xnode;
  7.               short side;
  8.  
  9.           D = fopen ("/tmp/DEBUG", "w");
  10.           pnt = TrPnt[2];
  11.           fprintf (D, "hashfile failure\n");
  12.           algbr (PV >> 8, PV & 0xff, 0);
  13.           fprintf (D, "inout move is %s\n", mvstr);
  14.           fprintf (D, "legal move are \n");
  15.           for (r = TrPnt[ply]; r < TrPnt[ply + 1]; r++)
  16.         {
  17.           xnode = &Tree[r];
  18.           algbr (xnode->f, xnode->t, (short) xnode->flags);
  19.           fprintf (D, "%s %s %s %s\n", mvstr[0], mvstr[1], mvstr[2], mvstr[3]);
  20.         }
  21.           fprintf (D, "\n current board is\n");
  22.           for (r = 8; r >= 0; r--)
  23.         {
  24.           for (c = 0; c <= 8; c++)
  25.             {
  26.               l = locn (r, c);
  27.                       if ( is_promoted[board[l]] )
  28.                         fprintf (D, "+");
  29.                       else 
  30.                         fprintf (D, " ");
  31.               if (color[l] == neutral)
  32.             fprintf (D, "-");
  33.               else if (color[l] == black)
  34.             fprintf (D, "%c", qxx[board[l]]);
  35.               else
  36.             fprintf (D, "%c", pxx[board[l]]);
  37.             }
  38.           fprintf (D, "\n");
  39.         }
  40.           fprintf (D, "\n");
  41.           for (side = black; side <= white; side++)
  42.           { short piece, c; 
  43.               fprintf(D, (side==black)?"black ":"white ");
  44.                   for (piece = pawn; piece <= king; piece++)
  45.                   if (c = Captured[side][piece]) 
  46.               fprintf (D, "%i%c ",c,pxx[piece]);
  47.                   fprintf (D, "\n");
  48.                 };
  49.           fclose (D);
  50.         }
  51. #endif
  52.